﻿@{
    ViewBag.Title = "面板";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script src="~/Scripts/highcharts/highcharts.js"></script>
<!--导航栏-->
@{
    @Html.Partial("_Location");
}

  <script type="text/javascript">
      /*获取json数据开始*/
      //定义变量
      $(document).ready(function () {
          var jsonXData = [];
          var jsonyD1 = [];
          var jsonyD2 = [];
          var jsonyD3 = [];
          //获取数据
          $.ajax({
              url: '@Url.Action("GetHotelMain","HotelChart",new{area="Chart"})',
              cache: false,
              async: false, 
              success: function (json) {
                  //var json = data;// eval("(" + data + ")"); 
                  if (json.Rows.length > 0) {
                      for (var i = 0; i < json.Rows.length; i++) {
                          var rows = json.Rows[i];
                          var Year = rows.PayTime;
                          var ShouldPay = rows.总收入;
                          var TruePay = rows.积分收入;
                          var jsonyD33 = rows.账单数量;
                          jsonXData.push(Year); //赋值
                          jsonyD1.push(ShouldPay);
                          jsonyD2.push(TruePay);
                          jsonyD3.push(jsonyD33);
                           
                      } //for
                      
                      var chart;
                      chart = new Highcharts.Chart({
                          chart: {
                              renderTo: 'container',//放置图表的容器
                              plotBackgroundColor: null,
                              plotBorderWidth: null,
                              defaultSeriesType: 'column'   //图表类型line, spline, area, areaspline, column, bar, pie , scatter 
                          },
                          title: {
                              text: '7日营业额',
                              style: { font: 'normal 13px 宋体' }
                          },
                          xAxis: {//X轴数据
                              categories: jsonXData,
                              lineWidth: 2,
                              labels: {
                                  rotation: 0, //字体倾斜
                                  align: 'center',
                                  style: { font: 'normal 13px 宋体' }
                              }
                          },
                          yAxis: {//Y轴显示文字
                              lineWidth: 2,
                              title: {
                                  text: '金额/元'
                              }
                          },
                          tooltip: {
                              formatter: function () {
                                  return '<b>' + this.x + '</b><br/>' +
                                  this.series.name + ': ' + this.y + '元';
                              }
                          },
                          plotOptions: {
                              column: {
                                  dataLabels: {
                                      enabled: true
                                  },
                                  enableMouseTracking: true//是否显示title
                              }
                          },
                          series: [{
                              name: '总收入',
                              data: jsonyD1
                          }, {
                              name: '积分收入',
                              data: jsonyD2
                          }]
                      });
                      
                      var chart1;
                      chart1 = new Highcharts.Chart({
                          chart: {
                              renderTo: 'container1',//放置图表的容器
                              plotBackgroundColor: null,
                              plotBorderWidth: null,
                              defaultSeriesType: 'column'   //图表类型line, spline, area, areaspline, column, bar, pie , scatter 
                          },
                          title: {
                              text: '7日订单数',
                              style: { font: 'normal 13px 宋体' }
                          },
                          xAxis: {//X轴数据
                              categories: jsonXData,
                              lineWidth: 2,
                              labels: {
                                  rotation: 0, //字体倾斜
                                  align: 'center',
                                  style: { font: 'normal 13px 宋体' }
                              }
                          },
                          yAxis: {//Y轴显示文字
                              lineWidth: 2,
                              title: {
                                  text: '数量/单'
                              }
                          },
                          tooltip: {
                              formatter: function () {
                                  return '<b>' + this.x + '</b><br/>' +
                                  this.series.name + ': ' + this.y + '单';
                              }
                          },
                          plotOptions: {
                              column: {
                                  dataLabels: {
                                      enabled: true
                                  },
                                  enableMouseTracking: true//是否显示title
                              }
                          },
                          series: [{
                              name: '订单数',
                              data: jsonyD3
                          } ]
                      });
                      //$("tspan:last").hide(); //把广告删除掉
                  } //if
              }
          });
      });
    	</script>
<!--/导航栏-->

<div class="line10"></div> 
<div class="nlist-2">
  <h3 onclick="javascript:window.location.href='@Url.Action("HotelEdit","Hotel")'"><i ></i>酒店信息</h3>
    <ul>
        @{ 
             <li>酒店名称：@ViewBag.Hotel.H_Name</li> 
             <li>酒店地址：@ViewBag.Hotel.Address</li>   
             <li>联系电话：@ViewBag.Hotel.Telphone</li>      
         }
    </ul>
</div>
<div class="line20" style="text-align: center"></div> 
<div class="nlist-5">
  <ul>
   @* <li><a onclick="parent.linkMenuTree(true, 'site_config');" class="icon-setting" href="javascript:;"></a><span>系统设置</span></li>
    <li><a onclick="parent.linkMenuTree(true, 'site_channel_category');" class="icon-channel" href="javascript:;"></a><span>频道分类</span></li>
    <li><a onclick="parent.linkMenuTree(true, 'app_templet_list');" class="icon-templet" href="javascript:;"></a><span>模板管理</span></li>
    <li><a onclick="parent.linkMenuTree(true, 'app_builder_html');" class="icon-mark" href="javascript:;"></a><span>生成静态</span></li>
    <li><a onclick="parent.linkMenuTree(true, 'app_plugin_list');" class="icon-plugin" href="javascript:;"></a><span>插件配置</span></li>
    <li><a onclick="parent.linkMenuTree(true, 'user_list');" class="icon-user" href="javascript:;"></a><span>会员管理</span></li>
    <li><a onclick="parent.linkMenuTree(true, 'manager_list');" class="icon-manaer" href="javascript:;"></a><span>管理员</span></li>
    <li><a onclick="parent.linkMenuTree(true, 'manager_log');" class="icon-log" href="javascript:;"></a><span>系统日志</span></li>*@
  </ul> 
</div>
<div class="nlist-2">
  <h3><i class="site"></i>交易额</h3>
  <div id="container" style="min-width:700px;height:400px"></div> 
  <h3><i class="site"></i>订单数</h3>
   <div id="container1" style="min-width:700px;height:400px"></div> 
</div>
<div class="line20"></div>
